import { MarkerType } from 'react-flow-renderer'

export const nodes = [
  {
    id: '1', // id必须
    type: 'input', // 类型: input开始  default默认  output结束 区别在于连接点不一样
    data: {
      // 节点名称
      label: (
        <div
          dangerouslySetInnerHTML={{
            __html: 'Welcome to <strong>React Flow!</strong> 111',
          }}
        ></div>
      ),
      value: 5, // 可以将其他数据放入
    },
    position: { x: 250, y: 0 }, // 节点位置
  },
  {
    id: '2',
    type: 'ResizableNodeSelected',
    data: {
      label: (
        <>
          This is a <strong>default node</strong>
        </>
      ),
    },
    position: { x: 100, y: 100 },
    style: { background: '#fff', border: '1px solid black', borderRadius: 15, fontSize: 12 },
  },
  {
    id: '3',
    data: {
      label: (
        <>
          This one has a <strong>custom style</strong>
        </>
      ),
    },
    position: { x: 400, y: 100 },
    style: {
      background: '#D6D5E6',
      color: '#333',
      border: '1px solid #222138',
      width: 180,
    },
  },
  {
    id: '4',
    position: { x: 250, y: 200 },
    data: {
      label: 'Another default node',
    },
  },
  {
    id: '5',
    data: {
      label: 'Node id: 5',
    },
    position: { x: 250, y: 325 },
  },
  {
    id: '6',
    type: 'output',
    data: {
      label: (
        <>
          An <strong>output node</strong>
        </>
      ),
    },
    position: { x: 100, y: 480 },
  },
  {
    id: '7',
    type: 'output',
    data: { label: 'Another output node' },
    position: { x: 400, y: 450 },
  },
  {
    id: '8',
    type: 'output',
    data: { label: 'new node more' },
    position: { x: 700, y: 350 },
  },
]

export const edges = [
  { id: 'e1-2', source: '1', target: '2', label: 'this is an edge label' },
  { id: 'e1-3', source: '1', target: '3' },
  {
    id: 'e3-4', // id必须
    source: '3', // 连接线起始节点id
    target: '4', // 连接线结束节点id
    animated: true, // 连接线是否有动画
    label: 'animated edge', // 连接线名称
  },
  {
    id: 'e4-5',
    source: '4',
    target: '5',
    label: 'edge with arrow head',
    markerEnd: {
      // 连接线尾部的箭头
      type: MarkerType.ArrowClosed,
    },
  },
  {
    id: 'e5-6',
    source: '5',
    target: '6',
    type: 'smoothstep', // 连接线类型 default straight step smoothstep
    label: 'smooth step edge',
  },
  {
    id: 'e5-7',
    source: '5',
    target: '7',
    type: 'step',
    style: { stroke: '#f6ab6c' }, // 连接线颜色
    label: 'a step edge',
    animated: true,
    labelStyle: { fill: '#f6ab6c', fontWeight: 700 }, // 连接线名称样式
  },
]
